int gcd (int x,int y)
{
    while(x!=y)
    {
        if(x>y) x-=y;
        else if(x<y) y-=x;
    }
    return x;
}
